home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / oop_tp55.zip / LIST3_4.PAS < prev    next >
Pascal/Delphi Source File  |  1990-03-08  |  1KB  |  53 lines

  1. program Listing3_4;
  2.  
  3. uses Tags, Crt, NewTags;
  4.  
  5. var
  6.    LT100,
  7.    FT100  : Analog;
  8.    PSL100 : LoSwitch;
  9.    PSH100 : HiSwitch;
  10.    EY100  : NewPump;
  11.    time   : integer;
  12.  
  13. { The following function will be used by the NewPump object.
  14.   Since it is used with a procedural variable, far calls
  15.   must be forced for compilation. }
  16. {$F+}
  17. function SystemPressure : real;
  18. begin
  19.      SystemPressure := HtToPSI(LT100.GetValue);
  20. end;
  21. {$F-}
  22.  
  23. begin
  24.  
  25.      LT100.Init( 'LT100', 512, 50, 250 );
  26.      FT100.Init( 'FT100', 2048, 0, 10000 );
  27.      PSL100.Init( 'PSL100', 60, SystemPressure );
  28.      PSH100.Init( 'PSH100', 75, SystemPressure );
  29.      EY100.Init( 'EY100', off, 100, 4.8e-7, @SystemPressure);
  30.      time := 0;
  31.  
  32.      repeat
  33.  
  34.      Inc( time );  { increment the time }
  35.      LT100.PutValue( LT100.GetValue - FlowToDeltaHt(FT100.GetValue) );
  36.  
  37.      PSL100.PutReading( SystemPressure );
  38.      PSH100.PutReading( SystemPressure );
  39.  
  40.      if Quiet.IsOff then
  41.         writeln( f, 'Level is ', LT100.GetValue:2:2, ' ft at minute ', time);
  42.  
  43.      if PSL100.GetStatus = on then
  44.         EY100.PutStatus( ON );
  45.      if PSH100.GetStatus = on then
  46.         EY100.PutStatus( OFF );
  47.      LT100.PutValue( LT100.GetValue + FlowToDeltaHt( EY100.Flow ));
  48.  
  49.      until KeyPressed;
  50.      Quiet.On;
  51. end.
  52.  
  53.